<extend name="Public/base" />

<block name="body">
    <div class="main-title">
        <h2>添加测试用户</h2>
    </div>
    <div class="cf">
        <div class="fl">
            <a class="btn btn-default" href="{:U('/admin/pushed/test')}&id={$_id}&bin={$_bin}">返回上一层</a>
        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <input type="text" name="uid" class="search-input" value="{:I('uid')}" placeholder="请输入UID">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('testin')}"><i class="btn-search"></i></a>
            </div>
        </div>
    </div>

    <!-- 数据列表 -->
    <div class="data-table table-striped">
        <table class="table table-hover">
            <thead>
            <tr>
                <th style="width: 8%">UID</th>
                <th style="width: 25%">nickname</th>
                <th style="width: 25%">openid</th>
                <th style="width: 10%">操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr>
                        <td>{$vo.id} </td>
                        <td>{$vo.nickname} </td>
                        <td>{$vo.openid}</td>
                        <td>
                            <a href="{:U('Pushed/addtestuser?id='.$vo['id'])}" class="confirm ajax-get btn btn-warning">添加</a>
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div>

    <div class="modal fade" id="myModal" tabindex="－1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content" style="margin-top: 100px;">
                <div id="qrcode" ></div>
            </div>
        </div>
    </div>

</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script type='text/javascript' src='http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js'></script>
    <script type="text/javascript" src="http://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>

    <script type="text/javascript">

        //搜索功能
        $("#search").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('input').serialize();
            var queryselect = $('.search-form').find('select').serialize();

            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            queryselect = queryselect.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            queryselect = queryselect.replace(/^&/g, '');

            if( url.indexOf('?')>0 ){
                url += '&' + query;
                url += '&' + queryselect;
            }else{
                url += '?' + query;
                url += '?' + queryselect;
            }
            window.location.href = url;
        });

        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });

        //导航高亮
        highlight_subnav('{:U('Pushed/index')}');
    </script>
</block>
